#pragma once
#include "CImageSource.h"


class ICoreAsyncAction;

class CBitmapSource :
	public CImageSource
{

public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	virtual XUINT32 GetTypeIndex() const;
	virtual XINT32 GetPixelWidth();
	virtual XINT32 GetPixelHeight();
	static HRESULT PixelWidth(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * pArgs, CValue * pResult);
	static HRESULT PixelHeight(struct Xcp_IDependencyObject * pObject, XUINT32 cArgs, CValue * pArgs, CValue * pResult);
	HRESULT SetSource(XUINT32 cInputSize, XUINT8 * pInputBuffer, ICoreAsyncAction * pCoreAsyncAction);
	HRESULT OnStreamImageAvailable(struct IImageAvailableResponse * pResponse);

protected: 
	CBitmapSource(CCoreServices * pCore);
	CBitmapSource();
	virtual HRESULT OnSourceSet();
	virtual HRESULT OnDownloadImageAvailable(struct IImageAvailableResponse * pResponse);
private: 
	ICoreAsyncAction * m_pAsyncAction;

};